$(function ()
{
    $("form").validate({
        rules : {
            "username" : {
                required : true
            },
            "password" : {
                required : true
            }

        },
        messages : {
            "username" : {
                required : '用户名不能为空'
            },
            "password" : {
                required : "密码不能为空"
            }
        },
        submitHandler : function (form)
        {
            var key = RSAUtils.getKeyPair(exponent, '', modulus);
            var username = $("#username").val();
            var password = $("#password").val();
            var enPassword = RSAUtils.encryptedString(key, password);
            $("#password").val(enPassword);
            form.submit();
        }
    });

});